
<!DOCTYPE html>
<html>
{[include file="_header.tpl"]}
<body>

<header class="navbar navbar-fixed-top bs-docs-nav">
    {[include file="_nav.tpl"]}
</header>

<main id="main" role="main">
    <div class="container docs-wrapper">
        <div class="row">

            <section id="content" class="col-lg-9 col-md-8 col-sm-8 col-xs-12">
                <h3>我的上网信息</h3>
                <p>{[$result.name]}[{[$result.id]}]，您好！</p>
                
                <p class="wintec-p" style="margin-top: 20px">
                {[if $msg neq '']}
                    {[$msg]}
                {[else]}
                	恭喜您，上网登录成功！请不要关闭此页面，以便使用需要。
                {[/if]}
                </p>

{[assign var="p1" value="`$result.r2/$result.t2`"]}
{[assign var="p2" value="`$result.r1/$result.t1`"]}
	
				<table class="table table-bordered">
					<tr>
						<td align="right">截止有效期：</td>
						<td>{[$result.indate]}</td>
					</tr>
					<tr>
						<td align="right">本日剩余流量：</td>
						<td>{[$result.r2*1024*1024|printsize]} 占比 {[$p1*100|string_format:"%.2f"]}%</td>
					</tr>
					<tr>
						<td align="right">本日总流量：</td>
						<td>{[$result.t2*1024*1024|printsize]} </td>
					</tr>
					
					<tr>
						<td align="right">本月剩余流量：</td>
						<td>{[$result.r1*1024*1024|printsize]} 占比 {[$p2*100|string_format:"%.2f"]}%</td>
					</tr>
					<tr>
						<td class="col-lg-3 col-sm-4 col-xs-5" align="right">本月总流量：</td>
						<td class="col-lg-9 col-sm-8 col-xs-7">{[$result.t1*1024*1024|printsize]}</td>
					</tr>
					<tr>
						<td align="right">允许同时在线：</td>
						<td>{[$result.c1]} 台</td>
					</tr>
					<tr>
						<td align="right">正在使用设备：</td>
						<td>{[$mac.name]} ({[$mac.mac]})
						{[if $mac neq '']}
						<a href="javascript:void(0)" onclick="mac_edit('{[$mac.mac]}')" class="btn btn-primary" role="button" >编辑</a>
						{[/if]}</td>
					</tr>
				</table>
            </section>

            <aside id="sidebar" class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
                {[include file="_left.tpl"]}
            </aside>

        </div>
    </div>
</main>

{[include file="_footer.tpl"]}

<script type="text/javascript">

function mac_edit(mac) {

	var url = "?do=Mac.edit&mac=" + mac;
	
	window.open(url, '_self');
}
</script>

</body>
</html>
